package thelperinator

import org.joda.time.Chronology
import org.joda.time.DateTime
import org.joda.time.DateTimeZone
import org.joda.time.Duration
import org.joda.time.Hours
import org.joda.time.chrono.CopticChronology
import org.joda.time.format.DateTimeFormat

/**
 * Created by rr146517 on 5/2/14.
 */
class dateandtime {
  /*
    def test() {

        def resone = new reservation()
        resone.length = 2
        def startone = new DateTime("2014-05-01T14:00:00")
        resone.start = startone
        resone.end = startone.plusHours(resone.length)

        def restwo = new reservation()
        resone.length = 3

        //def startone = new DateTime("2014-05-01T14:00:00")
        def endone = startone.plusHours(resone.length)
        def durone = new Duration(startone, endone)

        def starttwo = new DateTime("2014-05-01T15:00:00")
        def endtwo = starttwo.plusHours(2)
        def durtwo = new Duration(starttwo, endtwo)

        resone.check(durone, durtwo)

        def duronehours = durone.toStandardHours()
        //println Hours.hoursBetween(startone, starttwo).isLessThan(duronehours)



        def zone = DateTimeZone.forID("America/Lima")
        //def zone = DateTimeZone.forID("America/Los_Angeles")
        Chronology coptic = CopticChronology.getInstance(zone)
        //DateTime dt = new DateTime(coptic)
        DateTime dt = new DateTime()
        println "The time in Peru is:\t"
        //def fmt = DateTimeFormat.forPattern("M dd, yyyy hh:mm:ss aa zzz")
        def fmt = DateTimeFormat.forPattern("MMM dd, yyyy hh:mm")
        //println dt.toDateTime().toString(fmt)
        println dt.toDateTime(zone).toString(fmt)

        //resone.check(resone, restwo)

    }
  */
}
